<!-- start module contents -->

<script type="text/javascript">
<!--

// check input data
function inputchk(fm) {
	var errmsg="";
	if ( fm.blogtype.value != '0' && fm.blogurl.value == "") {
		alert("\n<{$smarty.const._MD_CONF_ALT0}>");
		return false;
	} else if ( fm.blogtype.value == '100' && fm.rss.value == "") {
		alert("\n<{$smarty.const._MD_CONF_ALT100}>");
		return false;
	} else {
		return true;
	}
}

function chgopenarea() {
	var cid=encodeURIComponent(document.getElementById("openarea").value);
	if(cid==10 || cid==20){
		document.getElementById("groups").style.display='block';
	}else{
		document.getElementById("groups").style.display='none';
	}
	if(cid==20){
                document.getElementById("personnel").style.display='block';
                D3dSuggest1 = new D3diaryUnameSuggest('<{$xoops_url}>/modules/<{$mydirname}>/','d3d_tag_input1','d3d_suggest_list1','d3d_tag_hidden1','d3d_tag_list1','<{$charset}>');
 	}else{
                document.getElementById("personnel").style.display='none';
                document.getElementById("d3d_tag_hidden1").value='';
                document.getElementById("d3d_tag_list1").innerHTML='';
                document.getElementById("d3d_tag_input1").value='';
                D3dSuggest1 = null;
	}
}

<{if $yd_cfg.openarea==20}>
document.observe("dom:loaded", function(){
    D3dSuggest1 = new D3diaryUnameSuggest('<{$xoops_url}>/modules/<{$mydirname}>/','d3d_tag_input1','d3d_suggest_list1','d3d_tag_hidden1','d3d_tag_list1','<{$charset}>');
});
<{/if}>

//-->
</script>

<{if $mod_config.show_breadcrumbs}>
<div id="d3d_breadcrumbs">
	<a href="<{$xoops_url}>/">TOP</a>
	<{foreach from=$xoops_breadcrumbs key="i" item="item"}>
	    <{* if $i!=0 *}>
		&nbsp;>&nbsp;
		<{if $item.url}>
			<a href="<{$item.url}>"><{$item.name}></a>
		<{else}>
			<{$item.name}>
		<{/if}>
	    <{* /if *}>
	<{/foreach}>
</div><br/>
<{/if}>

<{$smarty.const._MD_CAT_CONF}>&nbsp;<{$yd_cfg.cname}><br/>
<br/>

<form name="fm1" method='POST' action='index.php?page=editcat_config' onsubmit="return inputchk(this)">
<table class="outer" cellspacing="1">
<tr>
<th colspan=2>
<table style="border:0;margin:0;padding:0;"><tr>
<td><{$smarty.const._MD_CAT_CONF}></td><td style="text-align:right;"><img src="images/open<{$yd_cfg.openarea}>.gif" border=0 /></td>
</tr></table>
</th>
</tr>

<tr><td>
<strong><{$smarty.const._MD_CONF_BSELECT}></strong>
</td><td>

<{if $common_cat !=1}>
<select name="blogtype">
<{include file="db:`$mydirname`_inc_blog_options.html"}>
</select>
<{/if}>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<{if $yd_use_open_cat}>
<select name="openarea" id="openarea" onchange="chgopenarea()">
<option value="0"><{$smarty.const._MD_CONF2_OPEN}></option>
<option <{if $yd_cfg.openarea==1}>selected<{/if}> value="1"><{$smarty.const._MD_CONF2_1OLOSE}></option>
<{if $yd_use_friend>=1 && $yd_openarea<=1}><option <{if $yd_cfg.openarea==3}>selected<{/if}> value="3"><{$smarty.const._MD_CONF2_3FRIEND2}></option><{/if}>
<{if $yd_use_friend>=1 && ($yd_openarea<=1 || $yd_openarea==3)}><option <{if $yd_cfg.openarea==2}>selected<{/if}> value="2"><{$smarty.const._MD_CONF2_2FRIEND}></option><{/if}>
<{if $allow_gpermission}><option <{if $yd_cfg.openarea==10}>selected<{/if}> value="10"><{$smarty.const._MD_CONF2_10GROUP}></option><{/if}>
<{if $allow_ppermission}><option <{if $yd_cfg.openarea==20}>selected<{/if}> value="20"><{$smarty.const._MD_CONF2_20PERSON}></option><{/if}>
<{if $yd_openarea<=3}><option <{if $yd_cfg.openarea==100}>selected<{/if}> value="100"><{$smarty.const._MD_CONF2_100HIDE}></option><{/if}>
</select>
<{/if}>
<br />
<{if $common_cat !=1}><{$smarty.const._MD_CONF_BSELECTDESC}><br /><br /><{/if}>

<div id="groups" style="display:<{if $yd_cfg.openarea==10 || $yd_cfg.openarea==20}>block<{else}>none<{/if}>">
<{if $allow_gpermission || $allow_ppermission}><br />
<{$smarty.const._MD_PERMED_VGROUP}><br />
<select name="vgids[]" id="groups" size="4" multiple>
<{strip}><{foreach from=$yd_cfg.group_list key=groupid item=group}>
<option value="<{$groupid}>"<{if $group.gsel==1}> selected="selected"<{/if}>><{$group.gname}></option>
<{/foreach}><{/strip}></select>
<{/if}>
</div>

<div id="personnel" class="personnel" style="display:<{if $yd_cfg.openarea==20}>block<{else}>none<{/if}>">
<{if $allow_ppermission}>
<{strip}>
    <{$smarty.const._MD_DIARY_REG_PERSON}><br />
    <div id="d3d_tag_list1" class="d3d_tag_list"><{if $yd_cfg.pperm_names}>
    <{foreach from=$yd_cfg.pperm_names item="pname"}><span class="exist"><{$pname}></span><{/foreach}><{/if}></div>
    <input type="hidden" name="vpids" id="d3d_tag_hidden1" value="<{$yd_cfg.pperm_list}>">
    <{$smarty.const._MD_SEARCH_VPERSON}>&nbsp;<input size="25" id="d3d_tag_input1" name="d3d_tag_input1" autocomplete="off" class="form_text" type="text" ><br>
    <div id='d3d_suggest_list1' class="auto_complete"></div>
    <{$smarty.const._MD_SEARCH_VPERSONDESC}>
<{/strip}>
<{/if}>
</div>

</td></tr>

<{if $allow_html}>
<tr><td><b><{$smarty.const._MD_CATEGORY_HTML}></b></td>
      <td>
        <input type="checkbox" name="dohtml" id="dohtml" value="1" <{if $yd_cfg.dohtml==1}>checked<{/if}> />
        <{$smarty.const._MD_CATEGORY_HTMLDSC}><br />
</td></tr>
<{else}>
        <input type="hidden" name="dohtml" id="dohtml" value="0" />
<{/if}>

<{if $common_cat !=1}>
<tr><td>
<strong><{$smarty.const._MD_CONF_BURL}></strong>
</td><td>
<input type="text" name="blogurl" size="45" value="<{$yd_cfg.blogurl}>" />
<br />
<{$smarty.const._MD_CONF_BURLDESC}>
<br />
<{$smarty.const._MD_EXAMPLE}>http://blogsample.com/<br /><br />
</td></tr>

<tr><td>
<strong><{$smarty.const._MD_CONF_RSSURL}></strong>
</td><td>
<input type="text" name="rss" size="45" value="<{$yd_cfg.rss}>" />
<br />
<{$smarty.const._MD_CONF_RSSURLDESC}>
<br />
<{$smarty.const._MD_EXAMPLE}>http://blogsample.com/index.rdf<br /><br />
</td></tr>
<{/if}>

<tr><td colspan=2 style="text-align:center;">
<input type=hidden name="cid" value="<{$yd_cfg.cid}>"/>
<input type="hidden" name="common_cat" value="<{$common_cat}>" />
<input type=submit name="submit1" value="<{$smarty.const._MD_SUBMIT}>"/>
</td></tr>

</table>
</form>

<{if $debug_time}>
 <{foreach from=$debug_time item="debug"}>
	<{$debug.time}>:<{$debug.caller}><br />
 <{/foreach}>
<{/if}>
